package org.moonlight.jvm.natives.java.lang.floats;

import org.moonlight.jvm.natives.AbstractNativeMethod;
import org.moonlight.jvm.rtda.exclusive.Frame;

/**
 * java.lang.Float public static native int floatToRawIntBits(float value);
 *
 * @author Moonlight
 * @createTime 2023/9/22 16:08
 **/
public class FloatToRawIntBits extends AbstractNativeMethod {

    public FloatToRawIntBits() {
        super("java/lang/Float", "floatToRawIntBits", "(F)I");
    }

    @Override
    public void nativeMethod(Frame frame) {
        float val = frame.getLocalVars().getFloat(0);
        int intBits = Float.floatToRawIntBits(val);
        frame.getOperandStack().pushInt(intBits);
    }
}
